<h1 class='nika_page_title'><?php echo $topic->getName() ?></h1>

<?php include_partial('menu_message',array('topic'=>$topic)) ?>

<div class="paginate"><?php // if ($pager->haveToPaginate()): ?> <?php include_partial('paginate', array('pager' => $pager)) ?>
<?php // endif; ?></div>

<table id="sfForumTopicShow">

<?php foreach($pager->getResults() as $message): ?>
	<tr>
		<td class="sfForumTopicShowInfo"><?php include_component('myaccount','showuserblock', array('userid'=>$message->getAuthor())   ); ?>

		</td>
		<td class="sfForumTopicShowContent">
		
		<p class="sfForumShowEdited">создано <?php echo $message->getCreatedAt() ?>
		<?php if ($message->getUpdatedAt()!=$message->getCreatedAt()): ?> <br />
		редактировано <?php echo $message->getUpdatedAt(); ?></p>
		<?php endif; ?>
		
		<p class="message_content"><?php echo nl2br($message->getContent()) ?></p>

		<?php if($sf_user->isAuthenticated()): ?> <?php if ($sf_user->getGuardUser()->getId()==$message->getAuthor()): ?>
		<p><a style="font-size: 12px;"
			href="<?php echo url_for('sfForumMessage/edit?id='.$message->getId()) ?>">редактировать</a></p>
			<?php endif; ?> <?php endif; ?>
		
		</td>
	</tr>
<?php endforeach; ?>
<?php if(count($pager->getResults())<=0):?>
	<p style="margin:10px;">Сообщения в данной теме пока не созданы</p>
<?php endif;?>
</table>

<div class="paginate"><?php // if ($pager->haveToPaginate()): ?> <?php include_partial('paginate', array('pager' => $pager)) ?>
	<?php // endif ?></div>

	<?php if($sf_user->isAuthenticated()): ?>	
	<?php include_partial('form_message', array('form' => $form,'topic_id' => $topic->getId())) ?>	
	<?php endif; ?>